﻿@using Wlog.Web.Code.Helpers;
@using Wlog.Web.Code.Authentication;
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    @Styles.Render("~/Content/bootstrap.css")
    @Styles.Render("~/Content/metisMenu.css")
    @Styles.Render("~/Content/timeline.css")
    @Styles.Render("~/Content/sb-admin-2.css")
    @Styles.Render("~/Content/morris.css")
    @Styles.Render("~/Content/font-awesome.css")
    @Styles.Render("~/Content/Site.css");

    @Scripts.Render("~/Scripts/jquery-1.8.2.min.js")
    @Scripts.Render("~/Scripts/metisMenu.min.js")



    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->


</head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>

    <div id="wrapper">
        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <img src="/Content/images/logo.png" width="32" height="32" class="pull-right" /><a class="navbar-brand pull-left" href="/log">Wlog</a>
            </div>
            <!-- /.navbar-header -->
            <ul class="nav navbar-top-links navbar-right">

                <li>
                    @Html.ActionLink("Salve " + User.Identity.Name + "!", "Manage", "Account", routeValues: null, htmlAttributes: new { @class = "username", title = "Manage" })

                </li>
                <!-- /.dropdown -->
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i><i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li>
                            <a href="/account/info"><i class="fa fa-user fa-fw"></i>User Profile</a>
                        </li>
                        <li>
                            <a href="/account/manage"><i class="fa fa-gear fa-fw"></i>Settings</a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))
                            {
                                @Html.AntiForgeryToken()
                                <a href="javascript:document.getElementById('logoutForm').submit()">Disconnetti</a>
                            }

                        </li>
                    </ul>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
            </ul>
            <!-- /.navbar-top-links -->
            <div class="navbar-default sidebar" role="navigation">
                <div class="sidebar-nav navbar-collapse">
                    <ul class="nav" id="side-menu">
                        @*<li class="sidebar-search">
                            <div class="input-group custom-search-form">
                                <input type="text" class="form-control" placeholder="Search...">
                                <span class="input-group-btn">
                                    <button class="btn btn-default" type="button">
                                        <i class="fa fa-search"></i>
                                    </button>
                                </span>
                            </div>
                        </li>*@
                        <li>
                            <a href="/private"><i class="fa fa-dashboard fa-fw"></i>Dashboard</a>
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-list-alt fa-fw"></i>Logs<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="/private/Logs">All Logs</a>
                                </li>
                                @if (Membership.GetUser() != null)
                                {
                                    foreach (var app in UserHelper.GetAppsForUser(Membership.GetUser().UserName))
                                    {
                                    <li>
                                        <a href = "/private/Logs?applicationId=@app.IdApplication" >@app.ApplicationName </a>
                                    </li>
                                    }
                                }
@*<li>
                                    <a href="morris.html">add  one item for application...</a>
                                </li>*@
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        @if (UserProfileContext.Current.IsEditorUser)
                        {
                            <li>
                                <a href="/private/ListUsers"><i class="fa fa-users fa-fw"></i>Users</a>
                            </li>
                        }

                        <li>
                            <a href="/private/ListApps"><i class="fa fa-gear fa-fw"></i>Applications</a>
                        </li>

                        @if (UserProfileContext.Current.IsEditorUser)
                        {
                            <li>
                                <a href="/private/hangfire"><i class="fa fa-cogs fa-fw"></i>Backgroung jobs</a>
                            </li>
                        }
                        <li>
                            <a href="/Help"><i class="fa fa-link fa-fw"></i>Api Helper</a>
                        </li>
                        <li>
                            @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))
                            {
                                @Html.AntiForgeryToken()
@*<input type="submit" value="Logout" class="fa fa-sign-out fa-fw" />*@
                                <a href="javascript:document.getElementById('logoutForm').submit()"><i class="fa fa-sign-out fa-fw"></i>Logout</a>
                            }

                        </li>
                    </ul>

                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>
        <div id="page-wrapper">
            @RenderBody()
        </div>
        <!-- /#page-wrapper -->
    </div>
    <!-- /#wrapper -->







    @Scripts.Render("~/Scripts/bootstrap.min.js")
    <!-- Metis Menu Plugin JavaScript -->
    @Scripts.Render("~/Scripts/metisMenu.min.js")
    <!-- Morris Charts JavaScript -->
    @Scripts.Render("~/Scripts/raphael-min.js")
    @Scripts.Render("~/Scripts/morris.min.js")
    <!-- Custom Theme JavaScript -->
    @Scripts.Render("~/Scripts/sb-admin-2.js")
    @RenderSection("scripts", required: false)
</body>
</html>
